Release 10.1A: OpenEdge Development:
Programming Interfaces
Overview of tasks to implement 4GL sockets
Socket programming can be typically divided into three parts:
This section summarizes the tasks for programming sockets in the 4GL using the same framework. The sections that follow describe each of these tasks in more detail.
Table 17–2 lists socket programming tasks by application function, indicates whether each task is required for implementing socket communications, and provides a reference to a following section for more information on the task.
Table 17–2: Summary of socket programming tasks Application
function
Tasks Socket server
- Create a server socket object and enable it to listen for connections (
CONNECTevents) on a specified port (required). See the "Implementing a 4GL socket server" section.- Define a
CONNECTevent procedure to respond toCONNECTevents and return the socket object handle created for each connection (required). See the "Listening and responding to connection requests" section.- Make the server socket temporarily insensitive to
CONNECTevents. See the "Managing the server socket" section.- Disable the server socket from listening for new socket connections. See the "Managing the server socket" section.
- Delete the server socket object. See the "Managing the server socket" section.
Socket client
- Create a socket object to read and write data, and connect it to a port on a socket server (required). See the "Implementing a 4GL socket client" section.
Client or server
- Define and initialize a
MEMPTRvariable (required to read or write data on a socket). See the "Defining and initializing MEMPTR variables" section.- Test whether data is available to read on a socket. See the "Data detection using the procedural model" section.
- Define a
READ-RESPONSEevent procedure to respond to data coming in on a socket connection. See the "Data detection using the event-driven model" section.- Read data on a socket and test for the number of bytes read for each read operation. See the "Reading data on a socket" section.
- Write data on a socket and test for the number of bytes written for each write operation. See the "Writing data on a socket" section.
- Marshall data into a
MEMPTRbuffer for writing on a socket and unmarshall data from aMEMPTRbuffer after reading on a socket. See the "Marshalling and unmarshalling data for socket I/O" section.- Test whether a socket object is connected. See the "Managing sockets and their connections" section.
- Make a socket temporarily insensitive to
READ-RESPONSEevents. See the "Managing sockets and their connections" section.- Set and get socket options. See the "Managing sockets and their connections" section.
- Obtain the local and remote host IP addresses and port numbers involved in a socket connection. See the "Managing sockets and their connections" section.
- Disconnect a socket object from its remote host and port. See the "Managing sockets and their connections" section.
- Delete socket objects. See the "Managing sockets and their connections" section.
Socket security Note: SSL incurs heavy performance penalties, depending on the client, server, and network resources and load.
- Configure socket servers and clients for SSL. See the "Implementing 4GL socket security" section.
- Enable SSL server connections. See the "Enabling SSL server connections" section.
- Connect an SSL client to an SSL server. See the "Connecting an SSL client to an SSL server" section.
- Invoke socket operations. See the "Invoking socket operations for SSL sessions" section
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |